#include "gui.h"

void gui_init(Gui* gui, GtkBuilder* builder) {

	/* ustawienie wskaźników */
	
	gui->main = (GtkWindow*) gtk_builder_get_object (builder, "window");

	gui->firstPlayerBid = (GtkEntry*)gtk_builder_get_object(builder, "firstPlayerBid");
	gui->secondPlayerBid = (GtkEntry*)gtk_builder_get_object(builder, "secondPlayerBid");

	gui->wynik_label = (GtkLabel*) gtk_builder_get_object (builder, "label1");
	gui->plansza = (GtkDrawingArea*) gtk_builder_get_object(builder, "drawingarea1");
	
	gui->saveButton = (GtkButton*) gtk_builder_get_object(builder, "toolbutton2");
	
	gui->currentMove = (GtkDrawingArea*) gtk_builder_get_object(builder, "drawingarea2");
	
	gui->gameSizeDialog = (GtkDialog*) gtk_builder_get_object (builder, "dialog1");
	gui->biddingDialog = (GtkDialog*)gtk_builder_get_object(builder, "biddingDialog");
	
	gui->dialogSpinButton = (GtkSpinButton*) gtk_builder_get_object (builder, "spinbutton1");
	gui->dialogSpinButton2 = (GtkSpinButton*) gtk_builder_get_object (builder, "spinbutton2");

	gui->humanHuman = (GtkRadioButton*) gtk_builder_get_object (builder, "humanHuman");
	gui->humanComputer = (GtkRadioButton*) gtk_builder_get_object (builder, "humanComputer");
	gui->computerComputer = (GtkRadioButton*) gtk_builder_get_object (builder, "computerComputer");

	gui->circleGroups = (GtkLabel*) gtk_builder_get_object(builder, "circleGroups");
	gui->circleSymbols = (GtkLabel*) gtk_builder_get_object(builder, "circleSymbols");
	gui->circleResult = (GtkLabel*) gtk_builder_get_object(builder, "circleResult");

	gui->crossGroups = (GtkLabel*) gtk_builder_get_object(builder, "crossGroups");
	gui->crossSymbols = (GtkLabel*) gtk_builder_get_object(builder, "crossSymbols");
	gui->crossResult = (GtkLabel*) gtk_builder_get_object(builder, "crossResult");

	gui->statusBar = (GtkStatusbar*) gtk_builder_get_object(builder, "statusbar2");

	/* edytor */
	gui->editor = (GtkDialog*) gtk_builder_get_object(builder, "editor-window1");
	gui->editorBoardSizeDialog = (GtkDialog*)gtk_builder_get_object(builder, "editor-newboard");
	
	gui->editorDrawingArea = (GtkDrawingArea*)gtk_builder_get_object(builder, "editor-drawingarea1");
	gui->editorSpinButton = (GtkSpinButton*)gtk_builder_get_object(builder, "editor-spinbutton1");
	gui->editorEntry = (GtkEntry*)gtk_builder_get_object(builder, "editor-entry1");
	gui->editorBoardSize = (GtkSpinButton*)gtk_builder_get_object(builder, "editor-newboard-spinbutton1");
	gui->editorCircleBegins = (GtkRadioButton*)gtk_builder_get_object(builder, "editor-circleBegins");
	gui->editorCrossBegins = (GtkRadioButton*)gtk_builder_get_object(builder, "editor-crossBegins");

	gui->editorFixed = (GtkFixed*)gtk_builder_get_object(builder, "editor-fixed1");
	
	/* ustawienie wartości */
	gtk_spin_button_set_value(gui->dialogSpinButton, 7.00);
	gtk_spin_button_set_value(gui->dialogSpinButton2, 5.00);

	/* zablokowanie zapisu pustej planszy */
	gtk_widget_set_sensitive (GTK_WIDGET(gui->saveButton), FALSE);	

	gui->fixed = (GtkFixed*) gtk_builder_get_object (builder, "fixed1");

	/* Ukrycie elementów interfejsu */
	gtk_widget_hide_all(GTK_WIDGET(gui->fixed));
	gtk_widget_hide_all(GTK_WIDGET(gui->editorFixed));
	

}